package com.cxx.rabbit.utils;

import java.util.Random;

public class IdUtil {

    private final static Random RANDOM = new Random();

    private static String random6() {
        final int i = RANDOM.nextInt(1000000);
        return String.format("%06d", i);
    }

    public static String genOrderNo() {
        final long millis = System.currentTimeMillis();
        return millis + random6();
    }

    public static Long genOrderId() {
        final String orderNo = genOrderNo();
        return Long.parseLong(orderNo);
    }

}
